package com.tangding.shiro.support.thymeleaf;

import java.util.HashSet;
import java.util.Set;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.dialect.IDialect;
import org.thymeleaf.spring4.SpringTemplateEngine;

import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年11月14日_上午10:53:13
 *
 */
@Configuration
public class ThymeleafShiroSupport {
	
	@Autowired
	SpringTemplateEngine templateEngine;
	
	@PostConstruct
	public void init() {
		Set<IDialect> set = new HashSet<>();
		set.add(new ShiroDialect());
		templateEngine.setAdditionalDialects(set);
	}
}